home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS065.dsk
/
BUDGET INPUT.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
4KB
|
103 lines
10 DIM BU(30,13,2),S(30,15),R(13,2)
20 M1 = 0:M2 = 0
30 DIM B$(30),MN$(13)
40 D$ = CHR$(4)
50 NDIGITS = 1000
60 TEXT : HOME : PRINT "BUDGET DATA INPUT": PRINT "SET UP BUDGET ITEM STRINGS"
70 HOME : PRINT "INPUT BUDGET DATA": PRINT " USE -1 TO TERMINATE ITEM": PRINT : PRINT "BUDGET ITEM: ": POKE 34,6
80 GOSUB 580
90 REM
100 FOR J = 1 TO 30
110 IF S(J,1) < >0 THEN 130
120 HOME : PRINT B$(J): GOSUB 460: NEXT
130 REM CALCULATE RUNNING TOTALS
140 PRINT : PRINT "CALCULATING SUBTOTAL"
150 YT = 0
160 FOR MN = 1 TO 12
170 RT = 0: FOR K = 2 TO 15
180 IF S(J,K) = 0 THEN 200
190 RT = RT +BU(S(J,K),MN,1)
200 NEXT :BU(S(J,1),MN,1) = RT:YT = YT +RT: NEXT :BU(S(J,1),13,1) = YT
210 HOME : PRINT B$(J): FOR I = 1 TO 13: PRINT MN$(I); TAB( 20);BU(J,I,1): NEXT
220 INPUT "HIT RETURN TO CONTINUE";R$
230 NEXT
240 REM RUN UP RUNNING TOTALS
250 FOR J = 1 TO 30
260 BU(J,13,1) = 0: FOR I = 1 TO 12:BU(J,13,1) = BU(J,13,1) +BU(J,I,1): NEXT : NEXT
270 REM CALCULATE RATIOS
280 DL = 0:OV = 0: FOR MN = 1 TO 13
290 DL = DL +BU(5,MN,1):OV = OV +BU(30,MN,1)
300 R(MN,1) = INT(OV/DL *NDIGITS)/NDIGITS
310 NEXT
320 HOME : PRINT "EXPENSE TO INCOME RATIO": PRINT "MONTH"; TAB( 10);"BUDGET"
322 FOR MN = 1 TO 12: PRINT MN$(MN); TAB( 10);R(MN,1): NEXT
330 POKE 34,0
340 INPUT "OUTPUT FILE NAME? ";N$
350 IF LEN(N$) = 0 THEN 340
370 M1 = PEEK(107) +256 * PEEK(108)
380 M2 = PEEK(109) +256 * PEEK(110)
385 PRINT " IF ERROR THEN TYPE:": PRINT " BSAVE FILENAME,A";M1;",L";M2 -M1 +1
390 PRINT D$"BSAVE";N$;",A";M1;",L";M2 -M1 +1
400 INPUT "STRING FILE NAME? ";N$
410 PRINT D$"OPEN";N$: PRINT D$"WRITE";N$
420 FOR I = 1 TO 30: PRINT B$(I): NEXT I
430 FOR I = 1 TO 13: PRINT MN$(I): NEXT I
440 PRINT D$"CLOSE";N$
450 PRINT "DONE": STOP
460 REM INPUT SUBROUTINE
470 PRINT
480 FOR I = 1 TO 12: PRINT MN$(I)" ";: INPUT B1: IF B1 = -1 THEN 500
490 BU(J,I,1) = B1: NEXT I
500 BU(J,13,1) = 0
510 FOR I = 1 TO 12:BUDGT(J,13,1) = BUDGT(J,13,1) +BUDGT(J,I,1): NEXT I
520 PRINT "TOTAL ";BUDGT(J,13,1)
530 PRINT : INPUT " RESULTS OK? (Y OR N) ";Y$
540 IF Y$ < >"N" THEN RETURN
550 INPUT "MONTH ";I: PRINT BU(J,I,1);: INPUT " NEW VALUE ";B1: IF B1 <0 THEN 550
560 BU(J,I,1) = B1: GOTO 500
570 RETURN
580 REM BUDGET LABEL STRINGS
590 B$(1) = "INCOME #1"
600 B$(2) = "INCOME #2"
610 B$(3) = "OVERTIME"
620 B$(4) = "WINDFALL"
630 B$(5) = " TOTAL INCOME"
640 B$(6) = "MORTGAGE/RENT"
650 B$(7) = "REAL ESTATE TAXES"
660 B$(8) = "HEATING (GAS-OIL)"
670 B$(9) = "ELECTRICITY"
680 B$(10) = "AUTO LOAN"
690 B$(11) = " TOTAL FIXED COSTS"
700 B$(12) = "FOOD"
710 B$(13) = "TELEPHONE"
720 B$(14) = "GASOLINE/AUTO REPAIRS"
730 B$(15) = "SAVINGS"
740 B$(16) = "CLOTHING"
750 B$(17) = "ENTERTAINMENT/HOBBIES"
760 B$(18) = "MASTER CHARGE/VISA"
770 B$(19) = "SEARS"
780 B$(20) = "PENNY'S"
790 B$(21) = "MEDICAL EXPENSES"
800 B$(22) = "MISC CHARGE CARDS"
810 B$(23) = "MISC EXPENSES"
820 B$(24) = " TOTAL OVERHEAD"
830 B$(25) = "HOUSE/RENTER'S INS."
840 B$(26) = "LIFE INS."
850 B$(27) = "AUTOMOBILE INS."
860 B$(28) = "MISC. INS."
870 B$(29) = " TOTAL INSURANCE"
880 B$(30) = " TOTAL EXPENSES"
890 REM SET UP TOTAL ARRAY
900 FOR II = 1 TO 15: FOR JJ = 1 TO 30:S(JJ,II) = 0: NEXT : NEXT
910 S(5,1) = 5: FOR II = 2 TO 5:S(5,II) = II -1: NEXT
920 S(11,1) = 11: FOR II = 2 TO 6:S(11,II) = II +4: NEXT
930 S(24,1) = 24: FOR II = 2 TO 13:S(24,II) = II +10: NEXT
940 S(29,1) = 29: FOR II = 2 TO 5:S(29,II) = II +23: NEXT
950 S(30,1) = 30:S(30,2) = 11:S(30,3) = 24:S(30,4) = 29
960 MN$(1) = "JAN":MN$(2) = "FEB":MN$(3) = "MAR":MN$(4) = "APR":MN$(5) = "MAY":MN$(6) = "JUN"
970 MN$(7) = "JUL":MN$(8) = "AUG":MN$(9) = "SEP":MN$(10) = "OCT":MN$(11) = "NOV":MN$(12) = "DEC"
980 MN$(13) = " YEARLY TOTAL "
990 RETURN
63000 REM WRITTEN BY LOGAN R. ZINTSMASTER 12/27/80
63010 REM PERMISSION IS GRANTED TO REPRODUCE THIS PROGRAM FOR USE BY APPLE COMPUTER USER GROUPS
63020 REM ALL COMMERCIAL RIGHTS RESERVED